package cn.liwq.demo.java.raw.proxy;

import cn.liwq.demo.java.raw.proxy.entry.impl.FooA;
import cn.liwq.demo.java.raw.proxy.handler.LoggerHanlder;
import net.sf.cglib.proxy.Enhancer;

/**
 * <p>Project: demo-common </p>
 * 
 * <p>Function:  </p>
 * 
 * <p>Description:  </p>
 * 
 * <p>Copyright: Copyright(c) 2018 Ucarinc </p>
 * 
 * <p>Company: Ucarinc </p>
 * 
 * @author weiqiang.li@ucarinc.com
 * 
 * @date 2018-08-15 19:48:11
 * 
 * @version 1.0
 */
public class CglibProxyDemo {

    public static void main(String[] args) {
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(FooA.class);
        enhancer.setCallback(new LoggerHanlder());
        FooA fooA = (FooA) enhancer.create();
        fooA.print("hi man.");
    }
}
